package com.zbkj.admin.controller.publicly;

import com.zbkj.common.page.CommonPage;
import com.zbkj.common.request.PageParamRequest;
import com.zbkj.common.request.merchant.*;
import com.zbkj.common.response.*;
import com.zbkj.common.result.CommonResult;
import com.zbkj.service.service.MerchantService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 商户控制器
 +----------------------------------------------------------------------
 */
@Slf4j
@RestController
@RequestMapping("api/publicly/merchant")
@Api(tags = "平台端商户控制器")
public class PubliclyMerchantController {

    @Autowired
    private MerchantService merchantService;

    @ApiOperation(value="商户分页列表(展厅使用)")
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    public CommonResult<CommonPage<MerchantPagePubliclyResponse>> getPageList(@Validated MerchantSearchRequest searchRequest,
                                                                      @Validated PageParamRequest pageParamRequest) {
        return CommonResult.success(CommonPage.restPage(merchantService.getAdminPagePublicly(searchRequest, pageParamRequest)));
    }

}
